// ---------------------------------------------------------------------
//
// -- 镭射技能
// -- author £
//
// ---------------------------------------------------------------------

cc.Class({
    extends: cc.Component,

    properties: {
        an: cc.Animation
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
        this.node.active = false;
        // this.show(0, 0, 1);
    },

    start () {

    },

    show: function (x, y, d) {
        this.node.active = true;
        this.node.x = x;
        this.node.y = y;
        
        switch (d) {
            case 0:
                this.node.rotation = 0;
                break;
            case 1:
                this.node.rotation = 60;
                break;
            case 2:
                this.node.rotation = -60;
                break;
        }

        this.an.play();
    },

    hide: function () {
        this.an.stop();
        this.node.active = false;
    },

    // update (dt) {},
});
